#pragma once

#include "TestingFunction.h"
#include "CubicSplain.h"

class TaskBuilder
{
private:
	double left;
	double right;
	int numberGridPoints;
	TestingFunction function;
	CubicSplain spline;
	double leftGU;
	double rightGU;
	double* x;

public:
	TaskBuilder(double l, double r, int n, FunctionType f, double lgu, double rgu, bool autoGU);
	~TaskBuilder();

	TestingFunction* getFunction() { return &function; };
	CubicSplain* getSplain() { return &spline; };

	double getLeft() { return left; };
	double getRight() { return right; };
	int getNumGridPoints() { return numberGridPoints; };

	double getDifference(double x);
	double getDifferenceDiffOne(double x);
	double getDifferenceDiffTwo(double x);

	void getPrecision( int gridFrequency, double& x_max, double& max);
	void getPrecisionDiffOne(int gridFrequency, double& x_max, double& max);
	void getPrecisionDiffTwo(int gridFrequency, double& x_max, double& max);
};